﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Ckgl.aspx.cs" Inherits="Catering.Catering_Page.Kufang.Ckgl" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <link rel="stylesheet" type="text/css" href="../../Style/head.css" />
    <link rel="stylesheet" type="text/css" href="../../Style/center.css" />
    <script src="../../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script src="../../Style/xxk.js" type="text/javascript"></script>
    <link href="../../Style/dragdiv.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/dragdiv.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript" src="../../Scripts/My97DatePicker/WdatePicker.js"></script>
    <style type="text/css">
        .Create_Recipe
        {
            margin-top: 0;
        }
        .Create_Recipe
        {
            border: 1px solid #159aec;
            border-top: none;
            width: 998px;
        }
        .soso_lt
        {
            padding: 5px 0;
        }
        .soso_lt a
        {
            margin-left: 3px;
        }
        .style3
        {
            height: 21px;
        }
        .style4
        {
            width: 112px;
        }
        .div_120
        {
            padding-top: 5px;
            background-color: #e5f1ff;
        }
        .div_120 ul
        {
            width: 996px;
            clear: both;
        }
        .div_120 li
        {
            float: left;
            height: 25px;
            line-height: 25px;
            margin-left: 10px;
        }
        .div_120 span
        {
            text-align: left;
            display: -moz-inline-box;
            display: inline-block;
            width: 60px;
        }
        .rkgl_search{height:40px; width:998px; margin:0px; padding:0px;}
        .rkgl_search td{height:40px; line-height:30px; vertical-align:middle;}
        .swxx_table th{color: #0760ac; font-size:13px; font-weight:bold; background-image: url(../../Images/table_th_bg.gif); border-bottom: px; text-align:center; border-left:0px; line-height: 32px; height: 32px;}
        .swxx_table tbody td{ border-bottom: #b0b0b0 1px dashed; text-align: center; border-left: 0px; line-height: 28px; height: 28px; border-top: 0px; border-right: 0px; overflow:hidden; padding:0px; margin:0px; }
        .ckinfo_add{width:798px; height:278px; border:1px solid #c2def6;}
        .ckinfo_add h1{ font-size:14px; height:27px; line-height:27px; padding-left:10px; color:#1d67c0; background:url(../../Images/div_h1_bg.gif) 0 0 repeat-x;}
        .ckinfo_add h1 img{ float:left; margin-right:5px; position:relative; top:5px;*top:4px;_top:4px;}
        .ckinfo_add td{ padding:6px 0px;}
    </style>
    <script language="javascript" type="text/javascript">
        function but_add_info() {
            if ($("#Txt_riqi").val() == "") {
                alert("请选择日期!");
                return;
            }
            if ($("#Txt_shuliang").val() <= 0) {
                alert("数量必须大于0!");
                return;
            }
            if ($("#Txt_danwei").val() <= 0 || $("#Txt_danwei").val()=="") {
                alert("单位错误!");
                return;
            }
            var str_AddPice =
             $("#DDL_zuoyequ").val() + "," +
             $("#DDL_banzu").val() + "," +
             $("#DDL_kufang").val() + "," +
             $("#Txt_Raw_No").val() + "," +
             $("#Txt_riqi").val() + "," +
             $("#Txt_shuliang").val() + "," +
             $("#Txt_beizhu").val() + "," +
             $("#Txt_danjia").val() + "," +
             $("#Txt_danwei").find("option:selected").text() + "," +
             $("#Txt_guige").val() + "," +
             $("#Txt_dangqiankucun").val() + "," +
             $("#Txt_jine").val();
            $.ajax({
                type: "Post",
                url: "Ckgl.aspx/rkgl_add",
                data: "{'strMaxtype':'" + str_AddPice + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (data) {
                    if (data.d[0] == "OK") {
                        $("#Txt_danwei").val("");
                        $("#Txt_guige").val("");
                        $("#Txt_danjia").val("");
                        $("#Txt_yuanliaodalei").val("");
                        $("#Txt_yuanliaoxilei").val("");
                        $("#Txt_dangqiankucun").val("");
                        //                        $("#Txt_riqi").val("");
                        $("#Txt_jine").val("");
                        $("#Txt_zongjine").val("");
                        $("#Txt_beizhu").val("");
                        $("#Txt_Raw_No").val("");
                        $("#Txt_Raw_Name").val("");
                        alert("保存成功！");
                        window.location = $("#HF_URL").val();
                    }
                    else if (data.d[0] == "Other") {
                        alert("此日期前尚未入库，或库存不足，请检查之后再入库！");
                    }
                    else {
                        alert(data.d[0]);
                    }
                }
            });
        }
    </script>
    <%--<script language="javascript" type="text/javascript">
        function update_input_room_info(datas) {
            $.ajax({
                type: "Post",
                url: "../../PostDate.aspx/InputRoomInfo_Update",
                data: "{'strID':'" + datas + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (data) {
                    if (data.d.length > 0) {
                        $("#Hf").val(datas);
                        $("#dr_MaxType").val(data.d[0]);
                        $("#dr_MinType").val(data.d[1]);
                        $("#dr_Raw").val(data.d[2]);
                        $("#Txt_shuliang").val(data.d[3]);
                        document.getElementById("Txt_danwei").innerHTML = data.d[13];
                        $("#Txt_danwei").val(data.d[4]);
                        $("#Txt_guige").val(data.d[5]);
                        $("#Txt_danjia").val(data.d[6]);
                        $("#Txt_dangqiankucun").val(data.d[7]);
                        $("#Txt_riqi").val(data.d[8]);
                        $("#Txt_jine").val(data.d[9]);
                        $("#Txt_zongjine").val(data.d[9]);
                        $("#Txt_beizhu").val(data.d[10]);
                        $("#Txt_Raw_No").val(data.d[11]);
                        $("#Txt_Raw_Name").val(data.d[12]);
                        $("#but_Add").val("确认更新");
                        divshow("div1", "div2");
                    }
                }
            });
        }
    </script>--%>
    <script language="javascript" type="text/javascript">

        function but_add_infos() {
            var str_AddPice = datas + "," +
             $("#Price" + datas).val() + "," +
              $("#Numbers" + datas).val() + "," +
               $("#AmountMoney" + datas).val() + "," +
             $("#OutDate" + datas).val() + "," +
             $("#Back" + datas).val();

            $.ajax({
                type: "Post",
                url: "../../PostDate.aspx/rkgl_update",
                data: "{'strMaxtype':'" + str_AddPice + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (data) {
                    if (data.d != null) {
                        $("#InputDataBaseInfo").append(data.d[0]);
                        closedrag("div2");
                    }
                }
            });
        }
    </script>
    <script language="javascript" type="text/javascript">
        $(document).ready(function () {
            $("#Txt_Raw_Name").bind("blur", RawNameChanage);
            $("#Txt_Raw_No").bind("blur", RawIDChanage);
            $("#Txt_shuliang").bind("blur", NumberChanage);
            $("#Txt_danwei").bind("change", NumberDanweiChanage);
            $("#Txt_riqi").bind("blur", AddDateChange);
        });

        //根据品名带出相应信息 
        function RawNameChanage() {
            if ($("#Txt_Raw_Name").val() == "")
                return;

            if ($("#Txt_Raw_No").val() != "")
                return;

            if ($("#Txt_Raw_Name").val() != null && $("#Txt_Raw_Name").val().length > 1) {
                var str_AddPice = $("#DDL_zuoyequ").val() + "," +
              $("#DDL_banzu").val() + "," +
              $("#Txt_Raw_Name").val();
                $.ajax({
                    type: "Post",
                    url: "Ckgl.aspx/InputRoomRawName_Chanage",
                    data: "{'strID':'" + str_AddPice + "'}",
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function (data) {
                        if (data.d[0] == "OK") {
                            $("#Txt_Raw_No").val(data.d[1]);
                            $("#Txt_danjia").val(data.d[2]);
                            $("#HF_danjia").val(data.d[2]);
                            $("#Txt_dangqiankucun").val(data.d[3]);
                            $("#HF_dangqiankucun").val(data.d[3]);
                            $("#Txt_zongjine").val(data.d[4]);
                            $("#Txt_danwei").empty();
                            $("#Txt_danwei").append(data.d[7]);
                            $("#Txt_danwei").val(data.d[5]);
                            $("#Txt_guige").val(data.d[6]);
                            AddDateChange();
                        }
                    }
                });
            }
        }

        function RawIDChanage() {
            if ($("#Txt_Raw_No").val() == "")
                return;

            if ($("#Txt_Raw_Name").val() != "")
                return;

            if ($("#Txt_Raw_No").val() != null && $("#Txt_Raw_No").val().length > 2) {
                var str_AddPice = $("#DDL_zuoyequ").val() + "," +
              $("#DDL_banzu").val() + "," +
              $("#Txt_Raw_No").val();
                $.ajax({
                    type: "Post",
                    url: "Ckgl.aspx/InputRoomRawID_Chanage",
                    data: "{'strID':'" + str_AddPice + "'}",
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function (data) {
                        if (data.d[0] == "OK") {
                            $("#Txt_Raw_Name").val(data.d[1]);
                            $("#Txt_danjia").val(data.d[2]);
                            $("#HF_danjia").val(data.d[2]);
                            $("#Txt_dangqiankucun").val(data.d[3]);
                            $("#HF_dangqiankucun").val(data.d[3]);
                            $("#Txt_zongjine").val(data.d[4]);
                            $("#Txt_danwei").empty();
                            $("#Txt_danwei").append(data.d[7]);
                            $("#Txt_danwei").val(data.d[5]);
                            $("#Txt_guige").val(data.d[6]);
                            AddDateChange();
                        }
                    }
                });
            }
        }

        function NumberDanweiChanage() {
            var tem = $("#Txt_danwei").val();
            var num = $("#HF_dangqiankucun").val();
            if (Math.floor(tem) < 0) {
                $("#Txt_dangqiankucun").val((num / Math.abs(tem)).toFixed(2));
            }
            else {
                $("#Txt_dangqiankucun").val((tem * num).toFixed(2));
            }

            num = $("#HF_danjia").val();
            if (Math.floor(tem) < 0) {
                $("#Txt_danjia").val((num * Math.abs(tem)).toFixed(2));
            }
            else {
                $("#Txt_danjia").val((num / tem).toFixed(2));
            }
            if ($("#Txt_dangqiankucun").val() == "-1.00") $("#Txt_dangqiankucun").val("");
            NumberChanage();
        }
    </script>
    <script language="javascript" type="text/javascript">
        function Del_input_room_info(datas) {
            if (!confirm("确认删除?"))
                return;

            $.ajax({
                type: "Post",
                url: "Ckgl.aspx/rkgl_Del",
                data: "{'strID':'" + datas + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (data) {
                    if (data.d == "OK") {
                        alert("删除成功");
                        window.location = $("#HF_URL").val();
                    }
                }
            });
        }

    </script>
    <!-- 数量变化-->
    <script language="javascript" type="text/javascript">
        function fomatFloat(src, pos) {
            return Math.round(src * Math.pow(10, pos)) / Math.pow(10, pos);
        }

        function NumberChanage() {
            if ($("#Txt_Raw_No").val() == "")
                return;

            $("#span_error").text("");
            $("#but_Add").removeAttr("disabled");
            if (parseFloat($("#Txt_dangqiankucun").val()) < parseFloat($("#Txt_shuliang").val())) {
                $("#but_Add").attr("disabled", "disabled");
                //alert("超过库存");
                $("#span_error").text("超过库存");
            } else {
                var str_AddPice = $("#DDL_zuoyequ").val() + "," +
                          $("#DDL_banzu").val() + "," +
                          $("#DDL_kufang").val() + "," +
                          $("#Txt_Raw_No").val() + "," +
                          $("#Txt_shuliang").val();

                $.ajax({
                    type: "Post",
                    url: "Ckgl.aspx/Raw_outpu_wring",
                    data: "{'strMaxtype':'" + str_AddPice + "'}",
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function (data) {
                        if (data.d[0] == "OK") {
                            if ((parseFloat($("#Txt_dangqiankucun").val()) - parseFloat($("#Txt_shuliang").val())) < parseFloat(data.d[1])) {
                                $("#span_error").text("超出最低警线");
                            }
                        } else {
                            $("#span_error").text("没有设置警戒线");
                        }
                    }
                });
            }
            $("#Txt_jine").val(fomatFloat(parseFloat($("#Txt_danjia").val()) * parseFloat($("#Txt_shuliang").val()), 2));
            if ($("#Txt_jine").val() == "NaN") $("#Txt_jine").val("");
        }

        function Add() {
            showdrag("div2_drag", "div2");
            var temdate = $("#Txt_riqi").val();
            $("#div2 input[type='text']").val("");
            $("#Txt_riqi").val(temdate);
            $("#div2 textarea").val("");

        }
        function FlagYueDuTiJiao() {

            if (confirm("您确定要提交？")) {
                return true;
            }
            return false;
        }
        self.parent.frames["topFrame"].ddClass(2);

        function QuickAdd() {
            var zyq = $("#DDL_zuoyequ").val();
            var banzu = $("#DDL_banzu").val();
            var zyqindex = $("#DDL_zuoyequ").get(0).selectedIndex;
            var banzuindex = $("#DDL_banzu").get(0).selectedIndex;
            location.href = 'Ckgl_Add.aspx?GroupID=' + zyq + '&ClassID=' + banzu + '&ReturnURL=' + escape("Ckgl.aspx?sel_index_zyq=" + zyqindex + "&sel_index_bz=" + banzuindex);
        }

        function ExcelAdd() {
            var zyq = $("#DDL_zuoyequ").val();
            var banzu = $("#DDL_banzu").val();
            var zyqindex = $("#DDL_zuoyequ").get(0).selectedIndex;
            var banzuindex = $("#DDL_banzu").get(0).selectedIndex;
            location.href = 'Ckgl_ImportExcel.aspx?GroupID=' + zyq + '&ClassID=' + banzu + '&ReturnURL=' + escape("Ckgl.aspx?sel_index_zyq=" + zyqindex + "&sel_index_bz=" + banzuindex);
        }

        function ChangeCheckBox(obj) {
            if (obj.checked) {
                $("[name='CBO_ID']").attr("checked", "true");
            }
            else {
                $("[name='CBO_ID']").removeAttr("checked");
            }
        }

        function DeleteList() {
            var ids = "";
            var datetime = $("#TB_chaxun").val();
            var classid = $("#DDL_banzu").val();
            var groupid = $("#DDL_zuoyequ").val();
            $("[name='CBO_ID']").each(function () {
                if (this.checked) {
                    ids += $(this).val() + ",";
                }
            });
            if (ids.length == 0) {
                if (checkDate(datetime) == false) {
                    alert("至少选择一项或填写正确的日期格式！");
                    return;
                }
                else {
                    if (!confirm("您真的要删除当日所有数据？")) return;
                    $.ajax({
                        type: "Post",
                        url: "../../PostDate.aspx/Del_CkglListByDate",
                        data: "{'Del_Date':'" + datetime + "','ClassID':'" + classid + "','GroupID':'" + groupid + "'}",
                        contentType: "application/json; charset=utf-8",
                        dataType: "json",
                        success: function (data) {
                            if (data.d == "OK") {
                                alert("删除成功!");
                                var url = $("#HF_URL").val();
                                window.location = url;
                            }
                        }
                    });
                }
            }
            else {
                if (!confirm("您真的要删除所选？")) return;
                $.ajax({
                    type: "Post",
                    url: "../../PostDate.aspx/Del_CkglList",
                    data: "{'Del_Id':'" + ids + "'}",
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function (data) {
                        if (data.d == "OK") {
                            alert("删除成功!");
                            var url = $("#HF_URL").val();
                            window.location = url;
                        }
                    }
                });
            }
        }
        function checkDate(value) {
            if ((/^\d{4}-\d{1,2}-\d{1,2}$/).test(value) == false)
                return false;

            dateArr = value.split("-");
            monthPerDays = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
            year = dateArr[0];
            month = dateArr[1];
            day = dateArr[2];

            if (month > 12 || month < 0)
                return false;

            if (day > 31 || day < 0)
                return false;

            if (year % 100 == 0) {
                if (year % 400 == 0)
                    monthPerDays[1] = 29;
            }
            else {
                if (year % 4 == 0)
                    monthPerDays[1] = 29;
            }

            if (monthPerDays[month - 1] < day)
                return false;

            return true;
        }

        function AddDateChange() {
            var date = $("#Txt_riqi").val();
            var indbid = $("#Txt_Raw_No").val();
            var classid = $("#DDL_banzu").val();
            if (date != "" && indbid != "") {
                $.ajax({
                    type: "Post",
                    url: "Ckgl.aspx/Get_CkBalance",
                    data: "{'StrClassID':'" + classid + "','InDBID':'" + indbid + "','SearchDate':'" + date + "'}",
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function (data) {
                        if (data.d[0] == "OK") {
                            $("#HF_dangqiankucun").val(data.d[1]);
                        }
                        else {
                            $("#HF_dangqiankucun").val(0);
                        }
                        NumberDanweiChanage();
                    }
                });
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:HiddenField ID="Hf" runat="server" />
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div class="Center_Content" id="div2_1" style="display: block">
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <div style="width: 1000px; background-color: #FFFFFF; position:fixed; top:0px;">
                    <div style="height: 40px; width: 998px; background-color: #E5F1FF; border: 1px solid #C2DEF6; margin:10px 0px;">
                        <table border="0" cellpadding="0" cellspacing="0" class="rkgl_search">
                            <tr>
                                <td width="55" align="right">
                                    作业区：
                                </td>
                                <td width="90">
                                    <asp:DropDownList ID="DDL_zuoyequ" CssClass="select_input_bg" runat="server" AutoPostBack="true"
                                        Width="90px" OnSelectedIndexChanged="DDL_zuoyequ_SelectedIndexChanged">
                                    </asp:DropDownList>
                                </td>
                                <td width="40" align="right">
                                    班组：
                                </td>
                                <td width="75">
                                    <asp:DropDownList ID="DDL_banzu" runat="server" Width="75px" CssClass="select_input_bg">
                                    </asp:DropDownList>
                                </td>
                                <td width="40" align="right">
                                    库房：
                                </td>
                                <td width="50">
                                    <asp:DropDownList ID="DDL_kufang" runat="server" Width="50px" CssClass="select_input_bg">
                                    </asp:DropDownList>
                                </td>
                                <td width="40" align="right">
                                    按照：
                                </td>
                                <td width="85">
                                    <asp:DropDownList ID="DDL_an" runat="server" Width="80px" CssClass="select_input_bg"
                                        AutoPostBack="true" OnSelectedIndexChanged="DDL_an_SelectedIndexChanged">
                                        <asp:ListItem Value="RAWID">品号</asp:ListItem>
                                        <asp:ListItem Value="RAWName">品名</asp:ListItem>
                                        <asp:ListItem Value="RAWTID">原料大类</asp:ListItem>
                                        <asp:ListItem Value="RAWIDs">原料细类</asp:ListItem>
                                        <asp:ListItem Value="OutDate">出库日期</asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                                <td width="80">
                                    <asp:TextBox ID="TB_chaxun" runat="server" CssClass="input_bg" Height="22" Width="70px"></asp:TextBox>
                                </td>
                                <td width="90">
                                    <asp:HiddenField ID="HF_URL" runat="server" />
                                    <asp:Button ID="but_Seach" runat="server" CssClass="input_btn_a" Text="查　询" OnClick="but_Seach_Click" />
                                </td>
                                <td>
                                    &nbsp;
                                </td>
                                <td width="90">
                                    <input type="button" onclick='Add()' class="input_btn_a" value="添　加" />
                                </td>
                                <%if (IsAdmin())
                                  { %>
                                <td width="90">
                                    <input type="button" id="BT_Delete" value="批量删除" class="input_btn_a" onclick='DeleteList()' />
                                </td>
                                <%} %>
                                <td width="90">
                                    <input type="button" onclick="ExcelAdd()" class="input_btn_a" value="导入Excel" />
                                </td>
                                <!--
                                <td width="90">
                                    <asp:Button ID="Button2" runat="server" Text="月度提交" CssClass="input_btn_a" OnClientClick="return FlagYueDuTiJiao()"
                                        OnClick="Button2_Click" />
                                </td>
                                -->
                                <td width="90">
                                    <input type="button" onclick="QuickAdd()" class="input_btn_a" value="快速添加" />
                                </td>
                            </tr>
                        </table>
                    </div>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="swxx_table">
                        <thead>
                            <tr>
                                <%if (IsAdmin())
                                    { %>
                                <th width="6%">
                                    <input type="checkbox" onclick="ChangeCheckBox(this)" />全选
                                </th>
                                <%} %>
                                <th style="width: 5%">
                                    序号
                                </th>
                                <th style="width: 9%">
                                    原料大类
                                </th>
                                <th style="width: 9%">
                                    原料细类
                                </th>
                                <th style="width: 9%">
                                    品号
                                </th>
                                <th style="width: 10%">
                                    品名
                                </th>
                                <th style="width: 5%">
                                    单价
                                </th>
                                <th style="width: 8%">
                                    数量
                                </th>
                                <th style="width: 8%">
                                    金额
                                </th>
                                <th style="width: 5%">
                                    单位
                                </th>
                                <th style="width: 8%">
                                    出库日期
                                </th>
                                <th style="width: 5%">
                                    库房
                                </th>
                                <th style="width: 8%">
                                    备注
                                </th>
                                <th style="width: 5%">
                                    操作
                                </th>
                            </tr>
                        </thead>
                    </table>
                </div>
                <div style="height:62px; clear: both;">
                </div>
                <div style="width: 998px; border: #B0B0B0 1px solid; border-bottom: none; border-top: none;">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="swxx_table">
                        <thead>
                            <tr>
                                <%if (IsAdmin())
                                    { %>
                                <th width="6%">
                                    <input type="checkbox" onclick="ChangeCheckBox(this)" />全选
                                </th>
                                <%} %>
                                <th style="width: 5%">
                                    序号
                                </th>
                                <th style="width: 9%">
                                    原料大类
                                </th>
                                <th style="width: 9%">
                                    原料细类
                                </th>
                                <th style="width: 9%">
                                    品号
                                </th>
                                <th style="width: 10%">
                                    品名
                                </th>
                                <th style="width: 5%">
                                    单价
                                </th>
                                <th style="width: 8%">
                                    数量
                                </th>
                                <th style="width: 8%">
                                    金额
                                </th>
                                <th style="width: 5%">
                                    单位
                                </th>
                                <th style="width: 8%">
                                    出库日期
                                </th>
                                <th style="width: 5%">
                                    库房
                                </th>
                                <th style="width: 8%">
                                    备注
                                </th>
                                <th style="width: 5%">
                                    操作
                                </th>
                            </tr>
                        </thead>                      
                        <tbody id="InputDataBaseInfo">
                            <asp:Repeater ID="Repeater1" runat="server" OnItemDataBound="Repeater1_ItemDataBound">
                                <ItemTemplate>
                                    <tr style="background: #ffffff" onmouseover="this.style.background='#E3F5FF'" onmouseout="this.style.background='#FFFFFF'">
                                        <%if (IsAdmin())
                                          { %>
                                        <td>
                                            <input type="checkbox" name="CBO_ID" id='CBO_<%#Eval("id")%>' value='<%#Eval("id")%>' />
                                        </td>
                                        <%} %>
                                        <td>
                                            <%#GetXuNiIndex()%>
                                        </td>
                                        <td>
                                            <%# new Catering_Rules.RawMaterials().GetModel(Convert.ToInt32 (Eval("RAWTID"))).TypeName %>
                                        </td>
                                        <td>
                                            <%# new Catering_Rules.RawMaterialsInfo().GetModel(Convert.ToInt32(Eval("RAWIDs"))).Name %>
                                        </td>
                                        <td>
                                            <%# Eval("InDBid") %>
                                        </td>
                                        <td>
                                            <%# Eval("RAWName") %>
                                        </td>
                                        <td>
                                            <%# Eval("Price") %>
                                        </td>
                                        <td>
                                            <%# Eval("Numbers") %>
                                        </td>
                                        <td>
                                            <%# Eval("AmountMoney") %>
                                        </td>
                                        <td>
                                            <%# Eval("CMP") %>
                                        </td>
                                        <td>
                                            <%#  Convert.ToDateTime(Eval("OutDate")).ToShortDateString() %>
                                        </td>
                                        <td>
                                            <%# GetKuFang(Eval("DBID").ToString())%>
                                        </td>
                                        <td>
                                            <%# Eval("Back") %>&nbsp;
                                        </td>
                                        <td>
                                            <a href="#" name="delete<%# Eval("id") %>" onclick="Del_input_room_info(<%#Eval("id") %>)">
                                                删除</a>
                                        </td>
                                    </tr>
                                </ItemTemplate>
                            </asp:Repeater>
                        </tbody>
                    </table>
                    <table border="0" cellspacing="0" cellpadding="0" width="100%">
                        <tr>
                            <td align="left">
                                出库合计：<asp:Label ID="Lbl_FromRecodesNum" runat="server" Text="0"></asp:Label>
                            </td>
                            <td height="35" valign="middle">
                                <div class="paper_n">
                                    <ul>
                                        <li class="paper_H">
                                            <asp:HyperLink ID="InkFirst" runat="server">首页</asp:HyperLink></li>
                                        <li class="paper_U">
                                            <asp:HyperLink ID="InkPrev" runat="server">上一页</asp:HyperLink></li>
                                        <li class="paper_D">
                                            <asp:HyperLink ID="InkNext" runat="server">下一页</asp:HyperLink></li>
                                        <li class="paper_F">
                                            <asp:HyperLink ID="InkLast" runat="server">末页</asp:HyperLink></li>
                                    </ul>
                                </div>
                                <div class="paper_n2">
                                    <asp:Label ID="lblCurPage" runat="server"></asp:Label>
                                    <asp:Label ID="Label6" runat="server" Text="每页10条"></asp:Label>
                                </div>
                            </td>
                        </tr>
                    </table>
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    <div id="div1" class="bg">
    </div>
    <!--弹出层-->
    <div id="div2" class="center_div" style="width: 800px; height: 280px; padding: 0px;">
        <%--<asp:UpdatePanel ID="UpdatePanel2" runat="server">
            <ContentTemplate>--%>
        <div class="ckinfo_add">
            <h1 id="div2_drag">
                <img src="../../Images/cp_h1_03.gif" />添加出库信息 <span id="span_error" style="float: right;
                    margin-right: 20px; font-size: 12px; color: Red; font-weight: 400;"></span>
            </h1>
            <table width="100%" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td colspan="8" height="10">
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        品号：
                    </td>
                    <td>
                        <asp:TextBox ID="Txt_Raw_No" runat="server" Width="129px" CssClass="input_bg"></asp:TextBox>
                    </td>
                    <td align="right">
                        品名：
                    </td>
                    <td>
                        <asp:TextBox ID="Txt_Raw_Name" runat="server" Width="129px" CssClass="input_bg"></asp:TextBox>
                    </td>
                    <td align="right">
                        数量：
                    </td>
                    <td class="style4">
                        <asp:TextBox ID="Txt_shuliang" runat="server" Width="129px" CssClass="input_bg"></asp:TextBox>
                    </td>
                    <td align="right">
                        单位：
                    </td>
                    <td>
                        <%--<asp:TextBox ID="Txt_danwei" runat="server" ReadOnly="true" Width="30px" Style="border-style: none;"></asp:TextBox>--%>
                        <select id="Txt_danwei">
                        </select>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        规格：
                    </td>
                    <td>
                        <asp:TextBox ID="Txt_guige" runat="server" Width="129px" CssClass="input_bg"></asp:TextBox>
                    </td>
                    <td align="right">
                        单价(元)：
                    </td>
                    <td>
                        <asp:TextBox ID="Txt_danjia" runat="server" Width="129px" CssClass="input_bg"></asp:TextBox>
                        <input type="hidden" id="HF_danjia" />
                    </td>
                    <td align="right">
                        可出库量：
                    </td>
                    <td>
                        <asp:TextBox ID="Txt_dangqiankucun" runat="server" Width="129px" CssClass="input_bg"></asp:TextBox>
                        <input type="hidden" id="HF_dangqiankucun" />
                    </td>
                    <td align="right">
                        日期：
                    </td>
                    <td>
                        <asp:TextBox ID="Txt_riqi" runat="server" Width="129px" CssClass="input_bg"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        金额(元)：
                    </td>
                    <td>
                        <asp:TextBox ID="Txt_jine" runat="server" Width="129px" CssClass="input_bg"></asp:TextBox>
                    </td>
                    <td align="right">
                        总金额(元)：
                    </td>
                    <td>
                        <asp:TextBox ID="Txt_zongjine" runat="server" Width="129px" CssClass="input_bg"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        备注：
                    </td>
                    <td colspan="7">
                        <asp:TextBox ID="Txt_beizhu" runat="server" Width="529px" CssClass="input_bg" TextMode="MultiLine"
                            Height="50"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="3">
                    </td>
                    <td align="center">
                        <input type="button" id="but_Add" onclick="but_add_info()" class="input_btn_a" value="提　交" />
                    </td>
                    <td align="center">
                        <input type="button" id="but_Close" onclick='closedrag("div2")' class="input_btn_a"
                            value="关　闭" />
                    </td>
                    <td colspan="3">
                    </td>
                </tr>
            </table>
        </div>
        <%--</ContentTemplate>
        </asp:UpdatePanel>--%>
    </div>
    <div class="footer">
        <strong>中海油能源发展配餐服务公司渤海自营油田作业公司&nbsp;&nbsp;版权所有@CopyRight 2012</strong><span>技术支持：北京天择嘉业科技有限公司</span></div>
    </form>
</body>
</html>
